<div class="login window">
<h2>Log in</h2>
<form id="login-form" method="post" action="">
<label>Username</label>
<input type="text" class="uname" />
<label>Password</label>
<input type="password" class="pass" />
<div class="remember"><input type="checkbox" /> <span>Remember me</span></div>
<div class="forgot"><a href="#!forgot">Forgot your password?</a></div>
<div><input type="submit" value="Log in!" /></div>
</form>
</div>
<script type="text/javascript">
$("#login-form").submit(function (e) {
	e.preventDefault ();
	$.post("ajax/action.php", {
		"action" : "login",
		"uname" : $("input.uname").val(),
		"pass" : $("input.pass").val()
	}, function (data) {
		if (data.successful=="true") {
			login (data.uname);
			$.colorbox.close();
		}else{
			displayError (data.message, {
			"appendTo" : ".login.window",
			"onDisappear" : function () {
				$.colorbox.resize();
			}
		});
		$.colorbox.resize();
		}
	});
});
</script>